@extends('client/layoutIndex')

@section('link')
    <link rel="stylesheet" href="{{ asset('client/css/find.css') }}">
@stop

@section('content')
        <div class="find">
                <div class="find-center">
                    <div class="find-tit">
                        <h3 style="font-weight:bold;">兑换查询</h3>
                        <span></span>
                        <img src="{{ asset('client/image/xvxian.png') }}">
                        <span id="msg" style="display: none">
                            @if (count($errors) > 0)
                                @foreach ($errors->all() as $error)
                                    <div style="width: 100%;">
                                        <span style="color: red;display: block;margin: 0px auto;width: 200px;text-align: center;">{{ $error }}</span>
                                    </div>
                                @endforeach
                            @endif
                        </span>
                        <script type="text/javascript">
                            var _msg = $('#msg div span').text();
                            console.log(_msg);
                            if(_msg != ''){
                                layer.msg(_msg);
                            }
                        </script>
                    </div>
                    <form method="post" class="form-horizontal" action="{{ url('client/search') }}">
                        {{csrf_field()}}
                        <div class="form-group" style="margin:30px;">

                            <div class="col-md-offset-2 col-md-5 col-xs-8">
                                <input type="text" name="search" class="form-control" style="height:40px;">
                            </div>
                            <div class="col-md-2 col-xs-2" style="text-align:right;">
                                <input type="submit" class="btn btn-danger" value="查&nbsp;&nbsp;询" style="width:120px;font-weight:bold;font-size:18px;">
                            </div>
                        </div>
                    </form>

                    <div>
                        <table  class="table table-striped table-bordered table-hover table-condensed table-responsive">
                            <tr style="background:#ccc;">
                                <th>商品图片</th>
                                <th>商品信息</th>
                                <th>单价</th>
                                <th>数量</th>
                                <th>支付总金额</th>
                                <th>操作</th>
                            </tr>
                            @foreach($order as $o=>$value)
                            <tr class="active">
                                <td colspan="6" style="text-align:left;line-height:40px;padding:0px;">
                                    <span style="color:grey;">下单时间：</span>
                                    <span>{{ $value['create_time'] }}</span>
                                    <span style="width:30px;height:40px;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                    <span style="color:grey;">订单编号：</span>
                                    <span>{{ $value['order_id'] }}</span>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <img src="/productImg/{{ $value['pic'] }}" width="130px" height="100px" class="img-thumbnail">
                                </td>
                                <td>
                                    {{ $value['name'] }}
                                </td>
                                <td>
                                    <span>￥</span>
                                    <span>{{ $value['price'] }}</span>
                                </td>
                                <td>{{ $value['goods_num'] }}</td>
                                <td>{{ $value['total_price'] }}</td>
                                <td>
                                    @if($value['status'] == 1) 已兑换
                                    @else 未兑换
                                    @endif
                                    {{--<a href="{{ url('client/delOrder/'.$value['id']) }}">删除</a>--}}
                                </td>
                            </tr>
                            @endforeach

                        </table>
                        {{ $order->render() }}
                    </div>
                </div>
        </div>



@stop